package com.citytransport.prokopjuk.vehicleDTO;

/**
 * class Bus inherits abstract class Vehicle.
 * 
 * @author Prokopj'uk Oleksander
 * @version 1.2
 */
public class Bus extends Vehicle {
    private boolean crippleDoor;
    private int doorAmount;
    private int engineCapacity;
    private InternalCombustionEngineType engineType;

    /** No-arg constructor */
    public Bus() {
	super();
    }

    public Bus(int seatAmount, String vehicleNumber, String model,
	    boolean existCrippleDoor,  int doorAmount,
	    int engineCapacity, InternalCombustionEngineType engineType) {
	super(seatAmount, vehicleNumber, model);
	this.crippleDoor = existCrippleDoor;
	this.doorAmount = doorAmount;
	this.engineCapacity = engineCapacity;
	this.engineType = engineType;
    }
    
    public Bus(int ID,int seatAmount, String vehicleNumber, String model,
	    boolean existCrippleDoor, int doorAmount,
	    int engineCapacity, InternalCombustionEngineType engineType) {
	super(ID,seatAmount, vehicleNumber, model);
	this.crippleDoor = existCrippleDoor;
	this.doorAmount = doorAmount;
	this.engineCapacity = engineCapacity;
	this.engineType = engineType;
    }

    /**
     * Return existint-disexisting of door for cripple people.
     */
    public boolean isExistCrippleDoor() {
	return crippleDoor;
    }

    public int getDoorAmount() {
	return doorAmount;
    }

    public void setDoorAmount(int doorAmount) {
	this.doorAmount = doorAmount;
    }

    public InternalCombustionEngineType getEngineType() {
	return engineType;
    }

    public void setEngineType(InternalCombustionEngineType engineType) {
	this.engineType = engineType;
    }

    public int getEngineCapacity() {
	return engineCapacity;
    }

    public void setEngineCapacity(int engineCapacity) {
	this.engineCapacity = engineCapacity;
    }

    public String toString() {
	String word = "present";
	if (!isExistCrippleDoor()) {
	    word = "not present";
	}

	return super.toString() + " door for cripple " + word
		+ " amount of doors : " + getDoorAmount() + " engine - "
		+ getEngineType() + " engine capacity = " + getEngineCapacity();
    }

    public int hashCode() {
	return super.hashCode() + new Boolean(isExistCrippleDoor()).hashCode();
    }

}
